﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using socialnexus.classes.models;
using socialnexus.classes.pages;

namespace socialnexus.admin.Users
{
    public partial class Show : ProtectedPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SiteUser su = getSiteUser();
            lblFirstName.Text = su.FirstName;
            lblLastName.Text = su.LastName;
            imgPictureURL.ImageUrl = su.PictureURL;
            if (su.IsActive)
            {
                lblActive.Text = "Active";
                lblActive.ForeColor = System.Drawing.Color.Green;
                hlActivateSuspend.NavigateUrl = "~/admin/Users/Suspend.aspx?UserId=" + su.SiteUserId.ToString();
                hlActivateSuspend.Text = "Suspend";
            } else {
                lblActive.Text = "Suspended";
                lblActive.ForeColor = System.Drawing.Color.Red;
                hlActivateSuspend.NavigateUrl = "~/admin/Users/Activate.aspx?UserId=" + su.SiteUserId.ToString();
                hlActivateSuspend.Text = "Activate";
            }

            rptrUsers.DataSource = su.GetFriends();
            rptrUsers.DataBind();
            hlAddFriend.NavigateUrl += "?UserId=" + su.SiteUserId.ToString();

            hlEdit.NavigateUrl += "?UserId=" + su.SiteUserId.ToString();
        }
    }
}
